package com.wnx.db;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.query.Query;

import com.wnx.entity.School;
import com.wnx.util.HibernateUtil;

public class SchoolDao {
	public SchoolDao(){
		
	}
	
	public List getAllSchool(){
		Session session = HibernateUtil.getSession();
		session.beginTransaction();
		String hql = "from School";
		Query<School> query = session.createQuery(hql,School.class);
		List list=query.list();
		session.getTransaction().commit();
		session.close();
		return list;
	}
}
